#pragma once

#include <iostream>
#include <string>

#include "util.hpp"

namespace ns_log
{
    // 日志等级
    enum{
        INFO = 0,
        DEBUG,
        WARNING,
        ERROR,
        FATAL
    };

    std::ostream &Log(const std::string level, const std::string file_name, const int line)
    {
        std::string message;
        // 添加日志等级
        message += "[" + level + "]";
        // 添加报错文件名称
        message += "[" + file_name + "]";
        // 添加报错行
        message += "[" + std::to_string(line) + "]";
        // 日志时间戳
        message += "[" + ns_util::TimeUilt::GetTimestamp() + "]";

        std::cout << message;
        return std::cout;
    }

    #define LOG(level) (Log(#level, __FILE__, __LINE__))
}
